﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Assist;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI;
using YArchitech.Revit;
using YJKRevitStairs.StairsModel.CommonUnit;
using YJKRevitStairs.StairsModel.DataInfos;

namespace YJKRevitStairs.StairsModel.Manage
{
	internal class SteelStairsCreator : StairsCreator
	{
		public SteelStairsCreator(ExternalCommandData commandData) : base(commandData)
		{
		}

		public bool CreateSteelStairs(SteelStairs param_stairs)
		{
			FamilyInstance familyInstance = null;
			XYZ xyz = new XYZ(0.0, 0.0, 0.0);
			XYZ xyz2 = new XYZ(0.0, 0.0, 0.0);
			int nInsertPointIndex = param_stairs.m_nInsertPointIndex;
			List<double> list = new List<double>();
			this.GetFamilyType(ref param_stairs);
			using (Transaction transaction = new Transaction(this.m_Document, "SteelStairs"))
			{
				transaction.Start();
				if (!param_stairs.m_StairsType.IsActive)
				{
					param_stairs.m_StairsType.Activate();
				}
				Level genLevel = this.m_Document.ActiveView.GenLevel;
				StructuralType structuralType = 0;
				familyInstance = this.m_Document.Create.NewFamilyInstance(param_stairs.m_ptInsert, param_stairs.m_StairsType, genLevel, structuralType);
				this.ChangeSteelStairsParam(ref familyInstance, ref list, param_stairs);
				Location location = familyInstance.Location;
				this.GetInsertPointDeviation(param_stairs, list.ElementAt(0), ref xyz, ref xyz2, ref nInsertPointIndex);
				location.Move(xyz);
				location.Move(xyz2);
				transaction.Commit();
			}
			if (1E-06 < param_stairs.m_dRotateAngle)
			{
				this.RotateFamilyInstance(familyInstance, param_stairs.m_ptInsert, param_stairs.m_dRotateAngle);
			}
			if (param_stairs.m_bTBMirror)
			{
				this.TurnInstance(familyInstance, param_stairs);
			}
			using (Transaction transaction2 = new Transaction(this.m_Document, "Stairs Beam"))
			{
				transaction2.Start();
				this.ChangeSteelStairsBeamElevation(this.m_Document, ref param_stairs);
				XYZ ptTopStart = new XYZ(0.0, 0.0, 0.0);
				XYZ ptTopEnd = new XYZ(0.0, 0.0, 0.0);
				XYZ ptBottomStart = new XYZ(0.0, 0.0, 0.0);
				XYZ ptBottomEnd = new XYZ(0.0, 0.0, 0.0);
				this.GetBeamPoint(param_stairs, list, xyz, xyz2, nInsertPointIndex, ref ptTopStart, ref ptTopEnd, ref ptBottomStart, ref ptBottomEnd);
				StairsBeamCreator.CreateStairsBeam(this.m_Document, param_stairs, ptTopStart, ptTopEnd, ptBottomStart, ptBottomEnd);
				transaction2.Commit();
			}
			return true;
		}

		private void ChangeSteelStairsParam(ref FamilyInstance family, ref List<double> listStairsParam, SteelStairs param_stairs)
		{
			bool bRightAngle = param_stairs.m_bRightAngle;
			double dRotateAngle = param_stairs.m_dRotateAngle;
			if (bRightAngle)
			{
				listStairsParam.Add(family.GetParameter("角钢厚度").AsDouble());
				listStairsParam.Add(family.GetParameter("角钢长度").AsDouble());
				listStairsParam.Add(family.GetParameter("水平段角钢长度").AsDouble());
			}
			else
			{
				listStairsParam.Add(family.GetParameter("梯梁厚度").AsDouble());
				listStairsParam.Add(family.GetParameter("长度1").AsDouble());
				if (family.Name.Contains("C") || family.Name.Contains("D"))
				{
					listStairsParam.Add(family.GetParameter("平台长度").AsDouble());
				}
			}
			family.GetParameter("梯高").Set(param_stairs.m_dStairsHeight);
			family.GetParameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM).Set(param_stairs.m_dBottomOffset);
			if (!bRightAngle)
			{
				family.GetParameter("角度").Set(param_stairs.m_dStairsAngle);
			}
			family.GetParameter("梯宽").Set(param_stairs.m_dStairsWidth);
			family.GetParameter("扶手高度").Set(param_stairs.m_dRailingHeight);
			family.GetParameter("左侧扶手可见性").Set(param_stairs.m_nOutRailing);
			family.GetParameter("右侧扶手可见性").Set(param_stairs.m_nInnerRailing);
			if (!bRightAngle)
			{
				List<int> source = new List<int>();
				bool bNoteUpStairs = param_stairs.m_bNoteUpStairs;
                YJKRevitStairs.StairsModel.DataInfos.FloorType floorType = param_stairs.m_FloorType;
				this.ChangeSteelStairsFloorType(floorType, bNoteUpStairs, ref source);
				family.GetParameter("首层文字注释").Set(source.ElementAt(0));
				family.GetParameter("首层踏步").Set(source.ElementAt(1));
				family.GetParameter("中层文字注释").Set(source.ElementAt(2));
				family.GetParameter("中层踏步").Set(source.ElementAt(3));
				family.GetParameter("顶层文字注释").Set(source.ElementAt(4));
				family.GetParameter("顶层踏步").Set(source.ElementAt(5));
			}
			if (!bRightAngle)
			{
				double num = Math.PI;
				if ((param_stairs.m_bTBMirror || (0.0 == dRotateAngle % num && 0.0 != dRotateAngle)) && (!param_stairs.m_bTBMirror || 0.0 != dRotateAngle % num || 0.0 == dRotateAngle))
				{
					family.GetParameter("文字角度上").Set(Math.PI);
					family.GetParameter("文字角度下").Set(Math.PI);
				}
			}
		}

		private void ChangeSteelStairsBeamElevation(Autodesk.Revit.DB.Document doc, ref SteelStairs param_stairs)
		{
			double elevation = doc.ActiveView.GenLevel.Elevation;
			double dBottomOffset = param_stairs.m_dBottomOffset;
			param_stairs.m_BeamData.m_dElevation = elevation + dBottomOffset;
		}

        private void ChangeSteelStairsFloorType(YJKRevitStairs.StairsModel.DataInfos.FloorType FloorType, bool bNoteUpStairs, ref List<int> listFloorTypeParam)
		{
			listFloorTypeParam.Clear();
			int item = 0;
			int item2 = 0;
			int item3 = 0;
			int item4 = 0;
			int item5 = 0;
			int item6 = 0;
            if (FloorType == YJKRevitStairs.StairsModel.DataInfos.FloorType.FT_Bottom)
			{
				if (bNoteUpStairs)
				{
					item = 1;
				}
				item2 = 1;
			}
            else if (YJKRevitStairs.StairsModel.DataInfos.FloorType.FT_Mid == FloorType)
			{
				if (bNoteUpStairs)
				{
					item3 = 1;
				}
				item4 = 1;
			}
            else if (YJKRevitStairs.StairsModel.DataInfos.FloorType.FT_Top == FloorType)
			{
				if (bNoteUpStairs)
				{
					item5 = 1;
				}
				item6 = 1;
			}
			listFloorTypeParam.Add(item);
			listFloorTypeParam.Add(item2);
			listFloorTypeParam.Add(item3);
			listFloorTypeParam.Add(item4);
			listFloorTypeParam.Add(item5);
			listFloorTypeParam.Add(item6);
		}

		private void GetInsertPointDeviation(SteelStairs param_stairs, double dWidth, ref XYZ vecHori, ref XYZ vecVert, ref int nInsertIndex)
		{
			bool bRightAngle = param_stairs.m_bRightAngle;
			bool bTBMirror = param_stairs.m_bTBMirror;
			bool bLRMirror = param_stairs.m_bLRMirror;
			double dStairsWidth = param_stairs.m_dStairsWidth;
			double dStairsLength = param_stairs.m_dStairsLength;
			double num;
			if (bRightAngle)
			{
				num = dStairsWidth - dWidth * 2.0;
			}
			else
			{
				num = dStairsWidth + dWidth * 2.0;
			}
			if (bTBMirror && bLRMirror)
			{
				if (!bRightAngle)
				{
					nInsertIndex = (nInsertIndex + 2) % 4;
				}
				else if (nInsertIndex == 0)
				{
					nInsertIndex = 1;
				}
				else if (1 == nInsertIndex)
				{
					nInsertIndex = 0;
				}
			}
			else if (bLRMirror && bRightAngle)
			{
				if (nInsertIndex == 0)
				{
					nInsertIndex = 1;
				}
				else if (1 == nInsertIndex)
				{
					nInsertIndex = 0;
				}
			}
			else if (bTBMirror && !bRightAngle)
			{
				if (nInsertIndex == 0)
				{
					nInsertIndex = 1;
				}
				else if (1 == nInsertIndex)
				{
					nInsertIndex = 0;
				}
				else if (2 == nInsertIndex)
				{
					nInsertIndex = 3;
				}
				else if (3 == nInsertIndex)
				{
					nInsertIndex = 2;
				}
			}
			else if (bLRMirror && !bRightAngle)
			{
				if (nInsertIndex == 0)
				{
					nInsertIndex = 3;
				}
				else if (1 == nInsertIndex)
				{
					nInsertIndex = 2;
				}
				else if (2 == nInsertIndex)
				{
					nInsertIndex = 1;
				}
				else if (3 == nInsertIndex)
				{
					nInsertIndex = 0;
				}
			}
			if (bRightAngle)
			{
				if (bTBMirror && !bLRMirror)
				{
					if (nInsertIndex == 0)
					{
						vecVert = new XYZ(0.0, dStairsLength, 0.0);
						vecHori = new XYZ(-dWidth * 2.0, 0.0, 0.0);
						return;
					}
					if (1 == nInsertIndex)
					{
						vecHori = new XYZ(-dStairsWidth, 0.0, 0.0);
						return;
					}
				}
				else if (bTBMirror && bLRMirror)
				{
					if (nInsertIndex == 0)
					{
						vecHori = new XYZ(-dWidth * 2.0, 0.0, 0.0);
						return;
					}
					if (1 == nInsertIndex)
					{
						vecHori = new XYZ(-dStairsWidth, 0.0, 0.0);
						return;
					}
				}
				else if (1 == nInsertIndex)
				{
					vecHori = new XYZ(-num, 0.0, 0.0);
					return;
				}
			}
			else if (bTBMirror)
			{
				if (nInsertIndex == 0)
				{
					vecHori = new XYZ(dWidth * 2.0, 0.0, 0.0);
					return;
				}
				if (1 == nInsertIndex)
				{
					vecVert = new XYZ(0.0, -dStairsLength, 0.0);
					vecHori = new XYZ(dWidth * 2.0, 0.0, 0.0);
					return;
				}
				if (2 == nInsertIndex)
				{
					vecVert = new XYZ(0.0, -dStairsLength, 0.0);
					vecHori = new XYZ(-dStairsWidth, 0.0, 0.0);
					return;
				}
				if (3 == nInsertIndex)
				{
					vecHori = new XYZ(-dStairsWidth, 0.0, 0.0);
					return;
				}
			}
			else
			{
				if (1 == nInsertIndex)
				{
					vecVert = new XYZ(0.0, -dStairsLength, 0.0);
					return;
				}
				if (2 == nInsertIndex)
				{
					vecVert = new XYZ(0.0, -dStairsLength, 0.0);
					vecHori = new XYZ(-num, 0.0, 0.0);
					return;
				}
				if (3 == nInsertIndex)
				{
					vecHori = new XYZ(-num, 0.0, 0.0);
				}
			}
		}

		private void RotateFamilyInstance(FamilyInstance famIns, XYZ ptCenter, double dAngle)
		{
			Transaction transaction = new Transaction(this.m_Document, "rotate instance");
			transaction.Start();
			try
			{
				ElementTransformUtils.RotateElement(this.m_Document, famIns.Id, Line.CreateBound(ptCenter, new XYZ(ptCenter.X, ptCenter.Y, ptCenter.Z + 10.0)), dAngle);
				transaction.Commit();
			}
			catch (Exception)
			{
				transaction.RollBack();
			}
		}

		private void TurnInstance(FamilyInstance famIns, SteelStairs param_stairs)
		{
			Transaction transaction = new Transaction(this.m_Document, "Trans");
			transaction.Start();
			try
			{
				double dStairsWidth = param_stairs.m_dStairsWidth;
				double dStairsLength = param_stairs.m_dStairsLength;
				XYZ point = (famIns.Location as LocationPoint).Point;
				XYZ xyz = this.GetCenterPoint(dStairsWidth, dStairsLength, point) - point;
				xyz = Geometry.RotateTo(xyz, param_stairs.m_dRotateAngle, XYZ.BasisZ);
				XYZ xyz2 = point + xyz;
				ElementTransformUtils.RotateElement(this.m_Document, famIns.Id, Line.CreateBound(xyz2, new XYZ(xyz2.X, xyz2.Y, xyz2.Z + 10.0)), Math.PI);
				transaction.Commit();
			}
			catch (Exception)
			{
				transaction.RollBack();
			}
		}

		private XYZ GetCenterPoint(double dHori, double dVert, XYZ ptOrigin)
		{
			XYZ zero = XYZ.Zero;
			XYZ xyz = new XYZ(0.0, dVert, 0.0);
			XYZ xyz2 = new XYZ(dHori, 0.0, 0.0);
			XYZ ptEnd = ptOrigin + xyz;
			XYZ ptEnd2 = ptOrigin + xyz2;
			XYZ xyz3 = Geometry.CalculatMidPoint(ptOrigin, ptEnd);
			return new XYZ(Geometry.CalculatMidPoint(ptOrigin, ptEnd2).X, xyz3.Y, 0.0);
		}

		private void GetBeamPoint(SteelStairs param_stairs, List<double> listStairsParam, XYZ vecHori, XYZ vecVert, int nInsertIndex, ref XYZ ptTopStart, ref XYZ ptTopEnd, ref XYZ ptBottomStart, ref XYZ ptBottomEnd)
		{
			XYZ xyz = null;
			XYZ xyz2 = null;
			double num = 0.0;
			XYZ ptInsert = param_stairs.m_ptInsert;
			SteelStairsBeamData beamData = param_stairs.m_BeamData;
			bool bTopBeam = beamData.m_bTopBeam;
			bool bBottomBeam = beamData.m_bBottomBeam;
			bool bRightAngle = param_stairs.m_bRightAngle;
			bool bTBMirror = param_stairs.m_bTBMirror;
			double dStairsAngle = param_stairs.m_dStairsAngle;
			double dElevation = beamData.m_dElevation;
			double dElevation2 = beamData.m_dElevation;
			double dStairsHeight = param_stairs.m_dStairsHeight;
			string name = param_stairs.m_StairsType.Name;
			FamilySymbol beamType = param_stairs.m_BeamType;
			if (beamType == null)
			{
				return;
			}
			if (beamType.Name.Contains("GB-C"))
			{
				num = beamType.GetParameter("bf").AsDouble();
				double num2 = beamType.GetParameter("x").AsDouble();
				xyz2 = new XYZ(0.0, listStairsParam.ElementAt(1) - (num - num2), 0.0);
				xyz = new XYZ(0.0, num2, 0.0);
				if (bTBMirror && bRightAngle)
				{
					xyz = -xyz;
				}
			}
			else if (beamType.Name.Contains("HW"))
			{
				num = beamType.GetParameter("bf").AsDouble();
				xyz2 = new XYZ(0.0, -(num / 2.0 - listStairsParam.ElementAt(1)), 0.0);
				xyz = new XYZ(0.0, num / 2.0, 0.0);
			}
			double num3 = listStairsParam.ElementAt(0);
			XYZ xyz3 = new XYZ(num3, 0.0, 0.0);
			double num4 = listStairsParam.ElementAt(1);
			if (bBottomBeam)
			{
				XYZ xyz4 = new XYZ(0.0, 0.0, 0.0);
				XYZ xyz5 = new XYZ(0.0, 0.0, 0.0);
				if (1 == nInsertIndex || 2 == nInsertIndex)
				{
					xyz5 = new XYZ(0.0, param_stairs.m_dStairsHeight / Math.Tan(dStairsAngle), 0.0);
				}
				if (2 == nInsertIndex || 3 == nInsertIndex)
				{
					xyz4 = new XYZ(-param_stairs.m_dStairsWidth, 0.0, 0.0);
				}
				else
				{
					xyz4 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				}
				if (bTBMirror)
				{
					ptBottomStart = ptInsert - xyz3 * 2.0 - xyz2;
				}
				else
				{
					ptBottomStart = ptInsert + xyz2 - xyz5;
				}
				ptBottomEnd = ptBottomStart + xyz3 * 2.0 + xyz4;
				if (2 == nInsertIndex || 3 == nInsertIndex)
				{
					ptBottomStart += xyz3 * 2.0;
					ptBottomEnd -= xyz3 * 2.0;
				}
				if (bTBMirror && 2 == nInsertIndex)
				{
					XYZ xyz6 = new XYZ(0.0, 0.0, 0.0);
					xyz6 = ptBottomStart;
					ptBottomStart = ptBottomEnd;
					ptBottomEnd = xyz6;
				}
				else if (bTBMirror && (3 == nInsertIndex || nInsertIndex == 0))
				{
					XYZ xyz7 = XYZ.BasisY * param_stairs.m_dStairsHeight / Math.Tan(dStairsAngle);
					ptBottomStart += xyz7;
					ptBottomEnd += xyz7;
					if (3 == nInsertIndex)
					{
						XYZ xyz8 = new XYZ(0.0, 0.0, 0.0);
						xyz8 = ptBottomStart;
						ptBottomStart = ptBottomEnd;
						ptBottomEnd = xyz8;
					}
				}
				if (bTBMirror || 2 == nInsertIndex || 3 == nInsertIndex)
				{
					XYZ xyz9 = new XYZ(0.0, 0.0, 0.0);
					xyz9 = ptBottomStart;
					ptBottomStart = ptBottomEnd;
					ptBottomEnd = xyz9;
				}
			}
			if (bTopBeam)
			{
				double num5 = 0.0;
				if (2 < listStairsParam.Count)
				{
					num5 = listStairsParam.ElementAt(2);
				}
				double num6;
				if (bRightAngle)
				{
					num6 = num5 + num3;
				}
				else
				{
					num6 = param_stairs.m_dStairsHeight / Math.Tan(dStairsAngle);
				}
				XYZ xyz10 = new XYZ(0.0, 0.0, param_stairs.m_dStairsHeight);
				XYZ xyz11 = new XYZ(0.0, 0.0, 0.0);
				if (bTBMirror)
				{
					if (!bRightAngle)
					{
						if (beamType.Name.Contains("HW"))
						{
							xyz11 = new XYZ(0.0, -num, 0.0);
						}
						else
						{
							xyz11 = -xyz * 2.0;
						}
					}
					else if (beamType.Name.Contains("HW"))
					{
						xyz11 = new XYZ(0.0, -(num6 + num), 0.0);
					}
					else
					{
						xyz11 = new XYZ(0.0, -num6, 0.0);
					}
				}
				else
				{
					xyz11 = new XYZ(0.0, num6, 0.0);
				}
				ptTopStart = ptInsert + xyz + xyz10 + xyz11;
				if (name.Contains("C") || name.Contains("D"))
				{
					XYZ xyz12 = new XYZ(0.0, num5 - num4, 0.0);
					if (bTBMirror)
					{
						ptTopStart -= xyz12;
					}
					else
					{
						ptTopStart += xyz12;
					}
				}
				XYZ xyz13 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				if (bRightAngle)
				{
					if (bTBMirror)
					{
						ptTopStart += xyz3;
						ptTopEnd = ptTopStart + xyz13;
					}
					else
					{
						ptTopStart -= xyz3;
						ptTopEnd = ptTopStart + xyz13;
					}
				}
				else
				{
					ptTopEnd = ptTopStart + xyz3 * 2.0 + xyz13;
				}
				ptTopStart = ptTopStart + vecHori + vecVert;
				ptTopEnd = ptTopEnd + vecHori + vecVert;
				if (bTBMirror && !bRightAngle)
				{
					ptTopStart -= xyz3 * 2.0;
					ptTopEnd -= xyz3 * 2.0;
				}
				if (bTBMirror)
				{
					XYZ xyz14 = new XYZ(0.0, 0.0, 0.0);
					xyz14 = ptTopStart;
					ptTopStart = ptTopEnd;
					ptTopEnd = xyz14;
				}
			}
		}

		public void GetStairsType(ref SteelStairs param_stairs, Family family)
		{
			FamilySymbol stairsType = null;
			double num = param_stairs.m_dStairsAngle * 180.0 / Math.PI;
			double num2 = Common.FeetToMM(param_stairs.m_dStairsWidth);
			foreach (FamilySymbol familySymbol in family.GetSymbols())
			{
				if (familySymbol != null)
				{
					string name = familySymbol.Name;
					if (0.0 >= num - 35.5)
					{
						if (0.0 > num2 - 1200.0)
						{
							if (name.Contains("T5A09") || name.Contains("T5B09") || name.Contains("T5C09") || name.Contains("T5D09"))
							{
								stairsType = familySymbol;
								break;
							}
						}
						else if (name.Contains("T5A12") || name.Contains("T5B12") || name.Contains("T5C12") || name.Contains("T5D12"))
						{
							stairsType = familySymbol;
							break;
						}
					}
					else if (0.0 < num - 35.5 && 0.0 >= num - 45.0)
					{
						if (0.0 > num2 - 900.0 && (name.Contains("T4A07") || name.Contains("T4B07") || name.Contains("T4C07") || name.Contains("T4D07")))
						{
							stairsType = familySymbol;
							break;
						}
						if (0.0 <= num2 - 900.0 && 0.0 > num2 - 1200.0 && (name.Contains("T4A09") || name.Contains("T4B09") || name.Contains("T4C09") || name.Contains("T4D09")))
						{
							stairsType = familySymbol;
							break;
						}
						if (0.0 <= num2 - 1200.0 && (name.Contains("T4A12") || name.Contains("T4B12") || name.Contains("T4C12") || name.Contains("T4D12")))
						{
							stairsType = familySymbol;
							break;
						}
					}
					else if (0.0 < num - 45.0 && 0.0 >= num - 59.0)
					{
						if (0.0 > num2 - 700.0 && (name.Contains("T3A06") || name.Contains("T3B06") || name.Contains("T3C06") || name.Contains("T3D06")))
						{
							stairsType = familySymbol;
							break;
						}
						if (0.0 <= num2 - 700.0 && (name.Contains("T3A07") || name.Contains("T3B07") || name.Contains("T3C07") || name.Contains("T3D07")))
						{
							stairsType = familySymbol;
							break;
						}
					}
					else if (0.0 < num - 59.0 && 0.0 >= num - 73.0)
					{
						if (name.Contains("T2A06") || name.Contains("T2B06") || name.Contains("T2C06") || name.Contains("T2D06"))
						{
							stairsType = familySymbol;
							break;
						}
					}
					else if (0.0 <= num - 90.0 && "90°直钢梯_不带平台" == familySymbol.Family.Name)
					{
						stairsType = familySymbol;
						break;
					}
				}
			}
			param_stairs.m_StairsType = stairsType;
		}

		public void GetBeamType(ref SteelStairs param_stairs, Family family)
		{
			FamilySymbol beamType = null;
			string sBeamName = param_stairs.m_sBeamName;
			foreach (FamilySymbol familySymbol in family.GetSymbols())
			{
				if (familySymbol != null && familySymbol.Name.Contains(sBeamName))
				{
					beamType = familySymbol;
					break;
				}
			}
			param_stairs.m_BeamType = beamType;
		}

		public Family LoadFamily(Autodesk.Revit.DB.Document doc, string familyFileName)
		{
			string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(familyFileName);
			Family family = ElementFiltering.FindFamily(doc, fileNameWithoutExtension);
			Transaction transaction = new Transaction(doc, "LoadFamily");
			try
			{
				if (family == null)
				{
					Family family2 = null;
					transaction.Start();
                    doc.LoadFamily(familyFileName, out family2);
					transaction.Commit();
					family = family2;
				}
			}
			catch (Exception)
			{
				if ((int)transaction.GetStatus() == 1)
				{
					transaction.RollBack();
				}
			}
			return family;
		}

		public void GetFamilyType(ref SteelStairs param_stairs)
		{
			string str = FormParamManager.GetStairsFamiliyPath(param_stairs.m_sRvtVersion) + "SteelLadder\\";
			string str2 = param_stairs.m_sFamilyName;
			string str3 = ".rfa";
			string familyFileName = str + str2 + str3;
			Family family = this.LoadFamily(this.m_Document, familyFileName);
			this.GetStairsType(ref param_stairs, family);
			if (param_stairs.m_sBeamName.Contains("C"))
			{
				str2 = "热轧槽钢";
			}
			else if (param_stairs.m_sBeamName.Contains("HW"))
			{
				str2 = "热轧H型钢";
			}
			familyFileName = str + str2 + str3;
			family = this.LoadFamily(this.m_Document, familyFileName);
			this.GetBeamType(ref param_stairs, family);
		}
	}
}
